

//在PC端创建一个pipeline 
//用于采集、H264压缩 UDP/ＲＴＰ传输

#ifndef  __GSTCAM_PC_H
#define  __GSTCAM_PC_H

extern "C"{
#include <gst/gst.h>    
}
#include <ros/ros.h>
#include "gstcamera/video_status.h"


namespace gstcamera
{
    class Gstcam_pc
    {
    public:
        Gstcam_pc(ros::NodeHandle nh_camera,ros::NodeHandle nh_private);
        virtual ~Gstcam_pc();
        // Initialize and  configure the udp/RTP streaming pipeline
        //on pc gstreamer configuration
        bool configure_stream();
        //on TX1 gstreamer configuration
        bool configure_TX1_strema();

        //Control the stream start/stop/ cleanup
        void start_stream();
        void stop_stream();
        void cleanup_stream();

        //system calling
        void RTP_run();
        void TX1_run();

        bool video_switch(
    gstcamera::video_status::Request    &request_sta,
    gstcamera::video_status::Response   &Response_sta
        );

    
    private:
        /* video configure */
        GstElement *pipeline_;
        std::string gstconfig_;
        std::string  client_ip_;
        int client_port_;
        int width_,height_;
        int framerate_;
        ros::NodeHandle nh_;
        ros::NodeHandle nh_private_;

        ros::ServiceServer  video_server;
        
    };
    
}



#endif